class Promise{
    promiseState = 'ing'
    promiseResult = null
    constructor(callback){
        const resolve=(data)=>{
            if (this.promiseState !== 'ing') return
            this.promiseState = 'success'
            this.promiseResult = data
        }
        const reject=(data)=>{
            if (this.promiseState !== 'ing') return
            this.promiseState = 'error'
            this.promiseResult = data
        }
        callback(resolve,reject)
    }
}
Promise.prototype.then = function(res, err){ 
    if (this.promiseState === 'success'){
        res(this.promiseResult)
    }
    if (this.promiseState === 'error'){
        err(this.promiseResult)
    }
}
Promise.prototype.catch = function(){}
Promise.prototype.finally = function(){}
Promise.resolve = function(){}
Promise.reject = function(){}
Promise.all = function(){}
Promise.race = function(){}
Promise.allSettled = function(){}
Promise.any = function(){}